package com.czp.ssm.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.czp.ssm.bean.HotelOrder;
import com.czp.ssm.bean.Msg;
import com.czp.ssm.bean.Plane;
import com.czp.ssm.bean.PlaneOrder;
import com.czp.ssm.bean.TrainOrder;
import com.czp.ssm.service.HotelService;
import com.czp.ssm.service.PlaneService;
import com.czp.ssm.service.TrainService;

@Controller
@RequestMapping("/orderController")
public class OrderController {
	
	@Autowired
	private PlaneService planeService;
	@Autowired
	private TrainService trainService;
	@Autowired
	private HotelService hotelService;
	
	
	
	
	/**
	 * 飞机票订单列表
	 * @return
	 */
	@RequestMapping("/planeOrderList")
	public ModelAndView toPlaneOrderList() {
		List<PlaneOrder> planeOrderList = planeService.findAllPlaneOrders();
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("planeOrderList",planeOrderList);
		modelAndView.setViewName("/background/order/planeOrderList");
		return modelAndView;
	}
	
	

	/**
	 * 火车票订单列表
	 * @return
	 */
	@RequestMapping("/trainOrderList")
	public ModelAndView trainOrderList() {
		List<TrainOrder> trainOrderList = trainService.findAllPlaneOrders();
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("trainOrderList",trainOrderList);
		modelAndView.setViewName("/background/order/trainOrderList");
		return modelAndView;
	}
	
	
	
	/**
	 * 酒店订单列表
	 * @return
	 */
	@RequestMapping("/hotelOrderList")
	public ModelAndView hotelOrderList() {
		List<HotelOrder> hotelOrderList = hotelService.findAllHotelOrders();
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("hotelOrderList",hotelOrderList);
		modelAndView.setViewName("/background/order/hotelOrderList");
		return modelAndView;
	}
	
	
	
	
	
}
